package 笔试强训;

import java.util.Scanner;

/**
 * @Date 2024/10/14 22:56
 * @description: 添加逗号(模拟)
 * .
 * @Author LittleNight
 */
public class niuke146 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            char[] ch = in.next().toCharArray();
            int n = ch.length;
            StringBuffer sb = new StringBuffer();
            for (int i = 0; i < n; i++) {
                sb.append(ch[i]);
                // if (i%3==2 && i != n - 1) {
                if((n-i-1)%3 == 0 && i!=n-1) { // 注意这个判断条件. 上面那个不对
                    sb.append(",");
                }
            }
            System.out.println(sb.toString());
        }
    }

}
